package com.yaya.spring.theory.ioc;

public class IOCTest {
	public static void main(String[] args) {
		//之前的方式,主动创建
		/*
		Student s = new Student();
		Teacher t = new Teacher();
		t.setStudent(s);
		
		System.out.println(t);
		System.out.println(t.getStudent());
		*/
		
		//现在的方式,被动接收
		
		BeanFactory container = new BeanFactory();
		
		Teacher t = (Teacher)container.getBean("t");
		
		System.out.println(t);
		System.out.println(t.getStudent());
		
	}
}
